Update TOML dependency
authorAlex Crichton <alex@alexcrichton.com>
Wed, 7 Oct 2015 17:37:56 +0000 (10:37 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Wed, 7 Oct 2015 17:46:20 +0000 (10:46 -0700)
Closes #2031
Closes #2033

Cargo.lock
tests/test_bad_config.rs
tests/test_cargo_compile.rs

index 3f94ce0680bd5e617d037167a4e9ce17bb06878b..e3652630a0b3bf8749111d6a984e8a9944fbb84b 100644 (file)
@@ -27,7 +27,7 @@ dependencies = [
  "tempdir 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
  "term 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
  "time 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)",
- "toml 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)",
+ "toml 0.1.23 (registry+https://github.com/rust-lang/crates.io-index)",
  "url 0.2.37 (registry+https://github.com/rust-lang/crates.io-index)",
  "winapi 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
@@ -391,7 +391,7 @@ dependencies = [
 
 [[package]]
 name = "toml"
-version = "0.1.22"
+version = "0.1.23"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "rustc-serialize 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)",
index 069783906a36e90349ef974d8faaba45fb59d322..0854b4e4bcf4bfc8e2c8a09f2ed48858afb27c08 100644 (file)
@@ -190,7 +190,7 @@ Caused by:
 
 Caused by:
   could not parse input as TOML
-[..]config:2:1 expected `=`, but found eof
+[..]config:1:2 expected `=`, but found eof
 
 "));
 });
@@ -258,3 +258,29 @@ test!(bad_crate_type {
 warning: crate-type \"bad_type\" was not one of lib|rlib|dylib|staticlib
 "));
 });
+
+test!(malformed_override {
+    let foo = project("foo")
+    .file("Cargo.toml", r#"
+        [package]
+        name = "foo"
+        version = "0.0.0"
+        authors = []
+
+        [target.x86_64-apple-darwin.freetype]
+        native = {
+          foo: "bar"
+        }
+    "#)
+    .file("src/lib.rs", "");
+
+    assert_that(foo.cargo_process("build"),
+                execs().with_status(101).with_stderr("\
+failed to parse manifest at `[..]`
+
+Caused by:
+  could not parse input as TOML
+Cargo.toml:[..]
+
+"));
+});
index ebef666bf34759d1339807f10da7d45992bd887a..646b50651d3d79b63e41d24a37bfaaa8e42ed163 100644 (file)
@@ -2039,3 +2039,16 @@ test!(invalid_spec {
                     "could not find package matching spec `notAValidDep`".to_string()));
 
 });
+
+test!(manifest_with_bom_is_ok {
+    let p = project("foo")
+        .file("Cargo.toml", "\u{FEFF}
+            [package]
+            name = \"foo\"
+            version = \"0.0.1\"
+            authors = []
+        ")
+        .file("src/lib.rs", "");
+    assert_that(p.cargo_process("build").arg("-v"),
+                execs().with_status(0));
+});